package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_shipping;

//DAO   
public interface T_shippingMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_shipping  WHERE shipping_id = #{shipping_id}")
	public ApiT_shipping findT_shippingById(Integer shipping_id);

	// 查看数据集
	@Select("SELECT * FROM T_shipping")
	public List<ApiT_shipping> findT_shippings();

	// 添加
	@Insert("INSERT INTO t_shipping (order_id, user_id, shipping_price, status, shipping_remark, create_time, allocating_time, arrive_shop_time, take_goods_time, shipping_out_time, arrive_user_time, receive_order_time, start_time,is_ontime,on_delivery_money,cash_term_money) VALUES (#{order_id}, #{user_id}, #{shipping_price}, #{status}, #{shipping_remark}, #{create_time}, #{allocating_time}, #{arrive_shop_time}, #{take_goods_time}, #{shipping_out_time}, #{arrive_user_time}, #{receive_order_time}, #{start_time},#{is_ontime},#{on_delivery_money},#{cash_term_money})")
	@Options(useGeneratedKeys = true, keyProperty = "shipping_id")
	public int insertT_shipping(ApiT_shipping t_shipping);

	// 修改
	@Update("UPDATE t_shipping SET order_id = #{order_id}, user_id = #{user_id}, shipping_price = #{shipping_price}, status = #{status}, shipping_remark = #{shipping_remark}, create_time = #{create_time}, allocating_time = #{allocating_time}, arrive_shop_time = #{arrive_shop_time}, take_goods_time = #{take_goods_time}, shipping_out_time = #{shipping_out_time}, arrive_user_time = #{arrive_user_time}, receive_order_time = #{receive_order_time}, start_time = #{start_time},is_ontime=#{is_ontime},on_delivery_money=#{on_delivery_money},cash_term_money=#{cash_term_money} WHERE shipping_id = #{shipping_id}")
	public int updateT_shipping(ApiT_shipping t_shipping);

	// 删除
	@Delete("DELETE FROM t_shipping  WHERE shipping_id = #{shipping_id}")
	public int deleteT_shipping(Integer shipping_id);

	// Foreign keys revelant

	// region Indexs revelant

}
